home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
bioscloc.arc
/
BIOSCLOC.C
next >
Wrap
C/C++ Source or Header
|
1986-03-13
|
1KB
|
46 lines
/*
** Set the BIOS clock from the MS-DOS system clock
** for compatibles running MS-DOS 2.11
**
** 01/28/86 tal Lattice C
**
*/
#include "STDIO.H"
#include "CTYPE.H"
#include "DOS.H"
union REGS inregs;
union REGS outregs;
main(argc,argv)
int argc;
char *argv[];
{
int minute, second;
char hour_hi, hour_lo, min_hi, min_lo;
inregs.h.ah = 0x2c; /* get TIME function */
intdos(&inregs,&outregs);
hour_lo = outregs.h.ch; /* hour */
minute = outregs.h.cl; /* minute */
second = outregs.h.dh; /* second */
hour_hi = 0x0;
min_hi = ((18.205 * (minute * 60 + second)) / 256);
min_lo = (18.205 * (minute * 60 + second));
poke(0x0, 0x046F, &hour_hi, 1); /* put to time cells */
poke(0x0, 0x046E, &hour_lo, 1);
poke(0x0, 0x046D, &min_hi, 1);
poke(0x0, 0x046C, &min_lo, 1);
exit(0);
}